﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Web.Infrastructure.Storage;

namespace Web.Infrastructure.Reporting {
    public enum ActivityType
    {
        AboutPage = 1
    }

    public class UserActivity
    {
        public int Id { get; set; }
        public int ActivityTypeId { get; set; }
        public DateTime CreatedOn { get; set; }
        public string Username { get; set; }
    }

    public class UserActivityReporter {

        ISession _session;
        public UserActivityReporter(ISession session)
        {
            _session = session;
        }

        public void LogIt(string userName, ActivityType activity) {
            var log = new UserActivity();
            log.ActivityTypeId = (int)activity;
            log.CreatedOn = DateTime.Now;
            log.Username = userName;
            _session.Add(log);
            _session.CommitChanges();
        }
    }
}
